package com.ribbon.lcn.serviceb.repository;

import com.ribbon.lcn.serviceb.entity.Account;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @InterfaceName AccountRepository
 * @author: Ribbon
 * @Date 2019/3/21 15:06
 **/
public interface AccountRepository extends JpaRepository<Account,Integer> {
   @Modifying
   @Query("update account_tbl SET money = money - ?2 where userId = ?1")
    void debit(String userId, int money);
}
